package com.vishudha.concurrent.asynchronous;

import java.util.concurrent.Callable;

import com.vishudha.timer.event.VishudhaEvent;
import com.vishudha.timer.listner.VishudhaListner;

public class VishudhaCallable<T> implements Callable<T> {
	private VishudhaListner<T> listner;
	private VishudhaEvent<T> event;
	
	public VishudhaCallable(VishudhaListner<T> listner, VishudhaEvent<T> event) {
		this.listner = listner;
		this.event = event;
	}

	public T call() throws Exception {
		listner.onVishudhaEvent(event);
		return event.getEventHandler();
	}
}
